﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="/View/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/View/JS/zTree_v3/css/zTreeStyle/zTreeStyle.css" />
    <link rel="stylesheet" href="/View/CSS/MyClass.css" />
    <script src="/VIEW/JS/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="/VIEW/JS/laypage/laypage.js" type="text/javascript"></script>

    <script src="/VIEW/JS/avalon1.47.js" type="text/javascript"></script>
    <script>
        var model = avalon.define({
            $id: "Index",
            LXData: [],
            HYData: [{ "name": "科技需求", "issel": "n" }, { "name": "科技成果", "issel": "n" }, { "name": "行业热点", "issel": "n" }, { "name": "综合信息", "issel": "n" }],
            XMDATA: [],
            MC: "",
            ZY: "",
            GJZ: "",
            pageindex: 1,
            pagecount: 15,
            total: 0,
            selhy: function (item) {
                item.issel = item.issel == 'n' ? "y" : "n";
            },
            sellx: function (item) {
                item.issel = item.issel == 'n' ? "y" : "n";
            },
            viewxq: function (item) {
                parent.MyDialog.viewform("/View/Comon/CommonMangner.aspx?FormCode=XMCK&FormID=" + item.ID);
            },
            query: function () {
                //model.XMDATA = null;
                var lxdata = "";
                for (var i = 0; i < model.LXData.length; i++) {
                    if (model.LXData[i].issel == 'y') {
                        lxdata = lxdata + model.LXData[i].name + ",";
                    }
                }
                var hydata = "";
                for (var i = 0; i < model.HYData.length; i++) {
                    if (model.HYData[i].issel == 'y') {
                        hydata = hydata + model.HYData[i].name + ",";
                    }
                }
                $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_GETZLFLLISTNEW', { P1: lxdata, P2: hydata, MC: model.MC, ZY: model.ZY, GJZ: model.GJZ, p: 1, pagecount: model.pagecount }, function (resultData) {
                    if (resultData.ErrorMsg == "" && resultData.Result) {
                        model.XMDATA = resultData.Result;
                        model.total = resultData.Result1;
                        laypage({
                            cont: 'pageDiv', //容器。值支持id名、原生dom对象，jquery对象。
                            pages: Math.ceil(parseInt(resultData.Result1) * 1.0 / model.pagecount), //通过后台拿到的总页数
                            curr: 1, //初始化当前页
                            skin: 'molv',
                            jump: function (e) { //触发分页后的回调
                                if (e.curr != model.pageindex) {
                                    $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_GETZLFLLISTNEW', { p: e.curr, P1: lxdata, P2: hydata, MC: model.MC, ZY: model.ZY, GJZ: model.GJZ, pagecount: model.pagecount }, function (resultData) {
                                        model.XMDATA = resultData.Result;
                                    })
                                    model.pageindex = e.curr;
                                }
                            }
                        });


                    }
                })
            }
        })
        avalon.ready(function () {
            $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_GETZLFL', { P1: 6 }, function (resultData) {
                if (resultData.ErrorMsg == "" && resultData.Result) {
                    model.LXData = resultData.Result;
                }
            })
            //优秀QC成果和班组创新成果

        })




        //  })
    </script>
</head>
<body ms-controller="Index">
    <div class="container-fluid maindiv" style="margin: 20px">
        <div class="panel panel-default">
            <div class="panel-body">
                <div style="margin: 10px 0">
                    所属行业：
                      <label ms-repeat-item="LXData" class="checkbox-inline">
                          <input type="checkbox" ms-attr-value="item.name" ms-click="selhy(item)">
                          {{item.name}}
                      </label>
                </div>

                <div style="margin: 10px 0">
                    项目类型：
                        <label ms-repeat-item="HYData" class="checkbox-inline">
                            <input type="checkbox" ms-attr-value="item.name" ms-click="sellx(item)">
                            {{item.name}}
                        </label>

                </div>
                <div style="margin: 10px 0">
                    <span>项目名称：</span>

                    <input type="text" class="form-control" ms-duplex="MC" style="width: 300px; display: initial; height: 30px" />
                    <span style="margin-left: 20px">关&nbsp; 键 字：</span>
                    <input type="text" class="form-control" ms-duplex="GJZ" style="width: 300px; display: initial; height: 30px" />
                </div>
                <div style="margin: 10px 0">
                </div>
                <div style="margin: 10px 0">
                    <span>项目摘要：</span>

                    <input type="text" class="form-control" ms-duplex="ZY" style="width: 700px; display: initial; height: 30px" />

                    <button class="btn btn-success" style="margin-left: 40PX" ms-click="query()">点击查询</button>

                </div>
            </div>
        </div>


        <table class="table table-bordered table-condensed table-striped table-hover">
            <thead>
                <tr>
                    <td style="font-weight: bolder">序号</td>
                    <td style="font-weight: bolder">项目名称</td>
                    <td style="font-weight: bolder">信息类型</td>
                    <td style="font-weight: bolder">所属行业</td>
                    <td style="font-weight: bolder">关键词</td>
                    <td style="font-weight: bolder">操作</td>

                </tr>
            </thead>
            <tbody>
                <tr ms-repeat-item="XMDATA">
                    <td>{{$index+1}}</td>
                    <td>{{item.Name}}</td>
                    <td>{{item.Remark}}</td>
                    <td>{{item.hangye}}</td>
                    <td>{{item.guanjianci}}</td>
                    <td><a id="detail" style="margin-left: 20px" ms-click="viewxq(item)">查看详情</a></td>

                </tr>

            </tbody>
            <tfoot>
                <tr ms-visible="XMDATA.size()!=0">
                    <td colspan="6">
                        <div id="pageDiv" class="pull-right"></div>
                        <div class="">
                            <span>共{{total}}条记录</span>

                        </div>

                    </td>
                </tr>
                <tr ms-if="XMDATA.size()==0">
                    <td colspan="6">没数据啊
                    </td>
                </tr>
            </tfoot>
        </table>

    </div>

</body>
</html>
